<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <!--    <script type="text/javascript" src="../../js/jquery-3.6.js"></script>-->
    <script src="../../js/common.js"></script>
    <script type="text/javascript">
        window.onload = function () {
            let btn1 = document.getElementById('btn1');
            btn1.onclick = function () {
                let username = document.getElementById('username').value;
                alert(username);
            }
        }
    </script>
    <script type="text/javascript">
        $(function (){
            $('#btn2').click(function () {
               //let username = $('#username').val();
               let $username = $('#username');//一般jQuery对象变量前面都添加$符号来标识
               alert($username.val());
            });

            let date = new Date('2023-05-03 12:00:00')
            console.log(date.getTime())
            let dateNow = new Date()
            console.log(dateNow.getTime())
            console.log('持续时间'+(dateNow.getTime()-date.getTime())/(1000*60)+'minute')
        })
    </script>
</head>
<body>
<div>
    <input type="text" id="username"/>
    <button id="btn1">原生JS</button>
    <button id="btn2">jQuery方式</button>
</div>
</body>
</html>